<template>
  <div>
    <table v-for="i in ywlist" :key="i.id" border="1" cellspacing="0">
      <tr>=====================</tr>
      <tr>{{ i.title }}</tr>
      <tr v-for="(j,x) in i['params']" :key="j.id">
        <td>{{ x }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{j}}</td>
      </tr>
      <tr>
        <td>
          <van-button type="primary" @click="gonext(i.id)">允许通过</van-button>
          &nbsp;&nbsp;&nbsp;
          <van-button type="primary" @click="jiannext(i.id)">不允许通过</van-button>
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
import maxios from "@/http/axios";

export default {
  name: "spwork",
  data() {
    return {
      ywlist: []
    }
  },
  methods: {
    get_ywlist() {
      maxios('users/spM', 'get').then(res => {
        this.ywlist = res.list
      })
    },
    gonext(id) {
      maxios('/users/tgM?id='+id,'get').then(res=>{
        if(res.code==200){
          alert('ok')
        }else {
          alert('no')
        }
      })
    },
    jiannext(id){
      maxios('/users/tgMs?id='+id,'get').then(res=>{
        if(res.code==200){
          alert('ok')
        }else {
          alert('no')
        }
      })
    }
  },
  mounted() {
    this.get_ywlist()
  }
}
</script>

<style scoped>

</style>